import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

public class TestList {
    public static void main(String[] args) {

        String s = String.valueOf("");
        System.out.println(s);
        System.out.println(new Date("2023-10-20"));
        List<String> list = new ArrayList();
        list.add("a");
        list.add("c");
        list.add("g");
        list.add("b");
        list.add("d");
        list.add("e");
        list = list.stream().sorted((a, b) -> a.compareTo(b)).collect(Collectors.toList());
        //list.sort((a,b)->a.compareTo(b));
        System.out.println(list.toArray());
        String sss = list.stream().map(a -> a).reduce(new StringBuilder(), (sb, sb1) -> sb.append(sb1).append("-"),
                (sb1, sb2) -> sb1.append(sb2)).toString();
        System.out.println(sss);


        System.out.println(new BigDecimal("100.000").stripTrailingZeros());
        String[] a = "1:2".split(":|：");

        System.out.println(a[0]);
        System.out.println(a[1]);

        Integer type = 2022;
        System.out.println(type);
        System.out.println(type == 2);
        Double reviewTotalGasUse = 4590.4544;
        BigDecimal multiply = BigDecimal.valueOf(reviewTotalGasUse).multiply(BigDecimal.valueOf(10000));
        reviewTotalGasUse = multiply.doubleValue();
        System.out.println(reviewTotalGasUse);



       /* System.out.println((a / 10000) + "万");
        System.out.println(a);
        System.out.println(new BigDecimal("1292322232.2"));*/

       /* List<String> a = null;
        for (String s : a) {
            System.out.println(s);
        }

        a.stream().forEach(ss->{
            System.out.println(ss);
        });*/


        String aa = "79350082";
        System.out.println(Long.parseLong(aa, 16));

        // 1234  1 2  3 4
        // 0001*1000 + 0002*100 + 0003* 10 + 0004*1


        byte[] data = {(byte) 0x79, (byte) 0x35, (byte) 0x00, (byte) 0x82};
        long decodeData = ((0xff000000 & (data[0] << 24))
                | (0x00ff0000 & (data[1] << 16))
                | (0x0000ff00 & (data[2] << 8))
                | (0x000000ff & data[3])) & 0xffffffffL;
        System.out.println(decodeData);
        // 0000  1111001

        long a16 = 0x00110012;
        System.out.println(a16);
        long a161 = -0x00110012;
        System.out.println(a161);

        System.out.println((1000 << 4));
        System.out.println(1000 * Math.pow(2, 4));
        System.out.println(Long.toHexString(Double.doubleToLongBits(0.1d)).length());//3f b9 99 99 99 99 99 9a
        System.out.println(Double.longBitsToDouble(Long.parseLong("3fb999999999999a", 16)));//0.1

    }
}
